package runtime;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;

public class Jpmorgan {

    /**
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception {
//        long begin = System.currentTimeMillis();
//
//        WebAppContext webapp = new WebAppContext("webapp", "/jpmorgan");
//        webapp.setDefaultsDescriptor("./src/test/resources/runtime/webdefault.xml");
//
//        // add mock web.xml here to replace the default web.xml under webapp and enable mockMode
//        webapp.setDescriptor("./src/test/resources/runtime/web.local.xml");
//
//        Server server = new Server(9091);
//        server.setHandler(webapp);
//        server.start();
//        System.out.println("Jetty Server started, use " + (System.currentTimeMillis() - begin) + " ms");

        Server server = new Server(8080);

        WebAppContext context = new WebAppContext();
        context.setContextPath("/");
        context.setWar("/home/penghk/IdeaProjects/frameworkDemo/jpmorgan/target/jpmorgan-1.0-SNAPSHOT.war");
        server.setHandler(context);

        server.start();
        server.join();

    }

}
